package com.hjh.gameforum.mapper;


import com.hjh.gameforum.entity.UserProfile;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

@Mapper
public interface UserProfileMapper {

    @Select("SELECT * FROM user_profile WHERE user_id = #{userId}")
    UserProfile getUserProfile(int userId);

    void increaseLikes(int userId);

    void reduceLikes(int userId);

    void increaseTopics(Long userId);

    void reduceTopics(Long userId);

    void addUserProfile(Long userId);

    @Update("UPDATE user_profile SET introduction = #{introduction} WHERE user_id = #{userId}")
    void updateUserProfile(int userId, String introduction);
}
